package com.puman.beautyfarmcounselor.util;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import com.puman.beautyfarmcounselor.util.config.GlobalData;

/**
 * Created by puman on 15/7/21.
 */
public class MethedUtil {
    /**
     * 打印log
     * @param logStr log字符串
     */
    public static void UtilLog(String logStr){
        if (logStr == null ||logStr.length() == 0)
            return;
        Log.i(GlobalData.TAG,logStr);
    }

    /**
     *
     * @param context
     * @param toastStr
     */
    public static void UtilToast(Context context,String toastStr){
        Toast.makeText(context, toastStr, Toast.LENGTH_SHORT).show();
    }

    /**
     * 判断字符串中是否全是字符串
     * @param str
     * @return
     */
    public static boolean isNumeric(String str){
        for (int i = str.length();--i>=0;){
            if (!Character.isDigit(str.charAt(i))){
                return false;
            }
        }
        return true;
    }
}
